import request from '@/utils/request'

// 查询设备列表
export function listDevice(data) {
  return request({
    url: '/system/subDevice/subDeviceList',
    method: 'post',
    data: data
  })
}

// 查询参数详细
export function getDevice(configId) {
  return request({
    url: '/system/subDevice/' + configId,
    method: 'get'
  })
}

// 根据参数键名查询参数值
export function getDeviceKey(configKey) {
  return request({
    url: '/system/subDevice/configKey/' + configKey,
    method: 'get'
  })
}

// 新增参数配置
export function addDevice(data) {
  return request({
    url: '/system/subDevice/insertSubDevice',
    method: 'post',
    data: data
  })
}

// 修改参数配置
export function updateDevice(data) {
  return request({
    url: '/system/subDevice/updateSubDevice',
    method: 'post',
    data: data
  })
}

// 删除参数配置
export function delDevice(data) {
  return request({
    url: '/system/subDevice/delSubDevice',
    method: 'post',
    data: data
  })
}

// 刷新参数缓存
export function refreshCache() {
  return request({
    url: '/system/subDevice/refreshCache',
    method: 'delete'
  })
}
